package com.pig4cloud.pigx.contract.api.v1.controller;

import com.pig4cloud.pigx.common.core.util.R;
import com.pig4cloud.pigx.common.customize.api.annotation.OpenApi;
import com.pig4cloud.pigx.common.log.annotation.SysLog;
import com.pig4cloud.pigx.contract.api.v1.service.KLineServiceV1;
import com.pig4cloud.pigx.contract.open.api.dto.OpenApiKLineListDTOV1;
import com.pig4cloud.pigx.user.enums.UserApiKeyEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 开放API - k线 - v1版本
 *
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/v1/contract/k_line" )
@Api(value = "api_k_line_v1", tags = "开放api-k线")
public class KLineControllerV1 {

	private final KLineServiceV1 service;

	/**
	 * 获取k线列表数据
	 * @return R
	 */
	@ApiOperation(value = "获取k线列表数据", notes = "获取k线列表数据")
	@SysLog("获取k线列表数据" )
	@OpenApi(version = "1",permission = UserApiKeyEnum.Permission.READ,needSignature = true)
	@PostMapping("/list")
	public R<List<List<Object>>> getKLineList(@RequestBody OpenApiKLineListDTOV1 data){
		return service.getKLineList(data);
	}

}
